home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 2 / Atari Mega Archive CD - Volume 2.iso / prtfolio / new / porttpu.txt < prev    next >
Text File  |  1995-04-22  |  14KB  |  449 lines

  1. The Portfolio Unit, version 1.0  (c) 1990 BJ Gleason 
  2.  
  3. by BJ Gleason,  The American University 
  4.  
  5.  
  6. INTRODUCTION 
  7.  
  8.           The Portfolio Unit will allow Turbo Pascal programmers 
  9.      to access many of the features of the Portfolio. 
  10.  
  11.           Also included are some of the more important procedures 
  12.      and function from the CRT unit, which can not be used, since 
  13.      it expects full hard compatibility. 
  14.  
  15.  
  16. USING PORTFOLI.TPU 
  17.  
  18.           Place the file PORTFOLI.TPU in a directory where Turbo 
  19.      Pascal can access it. 
  20.  
  21.           In your program, include the name PORTFOLIO in the USES 
  22.      clause in you program. 
  23.  
  24.       
  25. FUNCTION AND PROCEDURES IN PORTFOLIO.TPU 
  26.  
  27. Replacements functions and procedures for the CRT unit: Will work 
  28. on Portfolio or PC 
  29.  
  30. PROCEDURE ClrScr; 
  31.  
  32.           Clear the screen. 
  33.  
  34.  
  35. PROCEDURE GotoXY(X,Y : Integer); 
  36.  
  37.           Move cursor to position X, Y. 
  38.  
  39.  
  40. FUNCTION  KeyPressed : Boolean; 
  41.  
  42.           Return TRUE if a key has been pressed. 
  43.  
  44.  
  45. FUNCTION  ReadKey : Char; 
  46.  
  47.           Wait for a key to be pressed, return the character. 
  48.  
  49.  
  50. FUNCTION  WhereX : Integer; 
  51.  
  52.           Return the Horizontal Position of the cursor. 
  53.  
  54. FUNCTION  WhereY : Integer; 
  55.  
  56.           Return the Vertical position of the cursor. 
  57.  
  58.  
  59. This function will work on the Portfolio or the PC. 
  60.  
  61. FUNCTION  IsPort : Boolean; 
  62.  
  63.           This function will return TRUE if running on a 
  64.           Portfolio, FALSE if not.  Handy if you want to run 
  65.           program on both machines without locking up the PC.  
  66.           WARNING: There is no positive way to identify the 
  67.           Portfolio.  This functions checks to see if the 
  68.           Interrupts 60h and 61h vectors are pointing to 
  69.           0000:0000.  These are not normally used on the PC, but 
  70.           is on the Portfolio.  If you are running a TSR that 
  71.           takes over these vectors, IsPort will return TRUE. 
  72.  
  73.  
  74. The rest of the procedures and function will only work on the 
  75. Portfolio, unless you are using the Portfolio Emulation Software 
  76. (I60, I61) on the PC. 
  77.  
  78. PROCEDURE PortAlarm; 
  79.  
  80.           This will beep the speaker, about once a second until 
  81.           the user presses a key.  The program will then continue 
  82.           with the next statement. 
  83.  
  84.  
  85. PROCEDURE PortBeep; 
  86.  
  87.           This will cause a single beep from the speaker. 
  88.  
  89.  
  90. PROCEDURE PortBox(X1,Y1,X2,Y2,Border : Integer); 
  91.  
  92.           This will draw a box.  X1 and Y1 specify the upper left 
  93.           corner position of the box, while X2 and Y2 specify the 
  94.           lower right corner.  Border is 0 for single line box, 
  95.           and 1 for a double line box. 
  96.   
  97.           Trying to draw a box larger than the screen (8x40) has 
  98.           unpredictable results. 
  99.  
  100.  
  101. FUNCTION  PortBoxAreaCalculation(var X,Y : Integer; Title, 
  102.                MenuText, DefaultText : String) : Integer; 
  103.  
  104.           This function will return the size of the menu in 
  105.           characters.  X and Y are the upper left hand corner.  
  106.           The function will modify X and Y so they point to the 
  107.           bottom right corner of the box.  Title, MenuText and 
  108.           DefaultText are the texts you are going to use in the 
  109.           menu.  These function is designed to work with 
  110.           PortScreenSaveAndRestore to calculate the amount of 
  111.           memory required to save the screen under the menu. 
  112.  
  113.  
  114. PROCEDURE PortDial(Number : String); 
  115.  
  116.           This will dial the "number" through the speaker.  Valid 
  117.           characters for tones are: 0 1 2 3 4 5 6 7 8 9 A B C D * 
  118.           #.  The letters must be in uppercase. 
  119.  
  120.  
  121. PROCEDURE PortErrorWindow(X,Y:Integer; Message : String); 
  122.  
  123.           This will draw a box around the message and display it 
  124.           at the specified X,Y.  It will then beep and wait for a 
  125.           keypress.  The text underneath the message is left 
  126.           untouched. 
  127.  
  128.           Trying to place the message outside the screen (8x40) 
  129.           has unpredictable results. 
  130.  
  131.  
  132. FUNCTION  PortGetCursorMode : Integer; 
  133.  
  134.           Returns the current cursor mode.  You can not detect 
  135.           mode 3, Force mode.  See PortSetCursorMode for details. 
  136.  
  137.  
  138. FUNCTION  PortGetDisplayMode : Integer; 
  139.  
  140.           This function will return the current display mode.  
  141.           See PortSetDisplayMode for details. 
  142.  
  143.  
  144. FUNCTION  PortGetKeyboardLanguage : Integer; 
  145.  
  146.           Returns the current keyboard language.  See 
  147.           PortSetKeyboardLanguage for details. 
  148.  
  149.   
  150. FUNCTION  PortGetLogicalScreenCols : Integer; 
  151.  
  152.           This function will return the width of the Logical 
  153.           Screen.  Used in conjunction with 
  154.           PortGetLogicalScreenRows will allow you to determine 
  155.           the overall size of the Logical screen. 
  156.  
  157. FUNCTION  PortGetLogicalScreenRows : Integer; 
  158.  
  159.           This function will return the number of rows of the 
  160.           logical screen. 
  161.  
  162.  
  163. FUNCTION  PortGetPhysicalScreenCols : Integer; 
  164.  
  165.           This function will return the width of the Physical 
  166.           Screen.  Used conjunction with 
  167.           PortGetPhysicalScreenRows will allow you to determine 
  168.           the overall size of the Physical screen. 
  169.  
  170.  
  171. FUNCTION  PortGetPhysicalScreenRows : Integer; 
  172.  
  173.           This function will return the number of rows of the 
  174.           Physical screen. 
  175.  
  176.  
  177. FUNCTION  PortGetSizeInternalDisk : Integer; 
  178.  
  179.           Returns the size of the internal disk in Ks. 
  180.  
  181.  
  182. FUNCTION  PortGetTextLanguage : Integer; 
  183.  
  184.           Returns the current text language.  See 
  185.           PortSetTextLanguage for details. 
  186.  
  187.   
  188. FUNCTION  PortGetTickSpeed : Integer; 
  189.  
  190.           Returns the Tick speed of the Portfolio.  See 
  191.           PortSetTickSpeed for details. 
  192.  
  193.  
  194. FUNCTION  PortGetVirtualScreenX : Integer; 
  195.  
  196.           Returns the current virtual cursor line. 
  197.  
  198.  
  199. FUNCTION  PortGetVirtualScreenY : Integer; 
  200.  
  201.           Returns the current virtual cursor column. 
  202.  
  203.  
  204. PROCEDURE PortInitialization; 
  205.  
  206.           Initialize the internal Interrupts.  Should be used 
  207.           before using any of the other routines. 
  208.  
  209. PROCEDURE PortKeyClick; 
  210.  
  211.           Make the key click sound. 
  212.  
  213.  
  214. FUNCTION  PortMenu(X, Y, Border, Depth, TopLine, SelectLine : 
  215.                Integer; Title, MenuText, DefaultText : String) : 
  216.                Integer; 
  217.  
  218.           This will display and allow the user to choose from a 
  219.           menu.  X and Y specify the position of the top left 
  220.           corner of the screen.  Border is 0 for a single line, 1 
  221.           for a double line.  If a single line is selected, the 
  222.           border and title are only drawn.  The Depth variable is 
  223.           a placeholder, and has no effect in version 1.0.  
  224.           Topline is the menu entry that should be at the top.  
  225.           SelectLine is the line the cursor will be set on.  The 
  226.           Title will be display on the Border of the menu.  The 
  227.           each entry in the MenuText has to be separated by an 
  228.           ASCII 0.  DefaultText values for each line will be 
  229.           displayed on the right hand side of the menu.  Each 
  230.           entry needs to be separated by an ASCII 0.  See 
  231.           TEST.PAS for an example. 
  232.  
  233.  
  234. PROCEDURE PortMessageWindow(X,Y : Integer; Title, Message : 
  235.                String); 
  236.  
  237.           The text of Message will be displayed in a double line 
  238.           box.  Each line of the Message needs to be separated by 
  239.           an ASCII 0.  The box will be placed at X, Y. 
  240.  
  241.  
  242. PROCEDURE PortMoveVirtualScreen(Direction, Distance : Integer); 
  243.  
  244.           Move the screen in direction for distance number of 
  245.           character.  Works only in Static and Tracked modes.  
  246.           Same as using the ALT arrow keys.  Values for direction 
  247.           are 1=Up,2=Down,3=Left,4=Right. 
  248.  
  249.  
  250. PROCEDURE PortOff; 
  251.  
  252.           This will turn the Portfolio off until the user presses 
  253.           a key.  The program will then continue execution. 
  254.  
  255.  
  256. PROCEDURE PortRefresh; 
  257.  
  258.           Copy video memory to the LCD controller.  Needed for 
  259.           when you are doing direct write to screen memory. 
  260.  
  261. FUNCTION  PortRomVersion : Real; 
  262.  
  263.           This function will return the version number of the 
  264.           Portfolio rom's. 
  265.